package com.pms.servlet;

import java.io.IOException;

import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.pms.entity.File;
import com.pms.service.FileService;
import com.pms.util.GetSession;

public class ShowfileServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setCharacterEncoding("utf-8");
		String fdid=request.getParameter("fdid");
		
		List<File> flist=new FileService().findByfdId(fdid); 
		GetSession.getSession(request).setAttribute("flist", flist);
		request.getRequestDispatcher("/WEB-INF/showfile.jsp").forward(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
	}

}
